package cn.edu.scau.cmi.zhengweixin.composite.safe;

public abstract class Component {
	
	String name;
	
	public Component(String name) {
		super();
		this.name = name;
	}

	public String doSomething(int level) {
		StringBuilder sb = new StringBuilder();
		while(level-- > 0) {
			sb.append(" ");
		}
		sb.append(name + "\n");
		return sb.toString();
	}

}
